home *** CD-ROM | disk | FTP | other *** search
- //
- // STAT.CPP [edit EMAIL.H before compiling]
- //
- // This (console mode) program dislays the number
- // of email messages waiting on the SMTP server.
- //
- // C++ version of STAT.C
- //
-
-
- #include <windows.h>
- #include <stdio.h>
- #include "see.h"
-
- #include "email.h"
-
- static char Buffer[512];
-
- void ErrorExit(int Code)
- {seeErrorText(Code,(LPSTR)Buffer,512);
- printf("SEE Error %d: %s\n", Code, Buffer);
- exit(1);
- }
-
- void main(int argc, char *argv[])
- {int Code;
- // define diagnostics log file
- seeStringParam(SEE_LOG_FILE, (LPSTR)"stat.log");
- // connect to POP3 server
- puts("Connecting...");
- Code = seePop3Connect(
- (LPSTR)POP3_HOST_NAME,
- (LPSTR)POP3_USER_NAME,
- (LPSTR)POP3_PASSWORD);
- if(Code<0) ErrorExit(Code);
- // get # messages waiting
- puts("Getting message status...");
- Code = seeGetEmailCount();
- if(Code<0) ErrorExit(Code);
- printf("%d messages waiting\n", Code);
- seeClose();
- }
-
-
-
-